﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Entity.ModelConfiguration.Conventions;
using LifeTree.DomainModel.Entities;

namespace LifeTree.EntityFrameworkProvider
{
    public class LifeTreeContext : DbContext, ILifeTreeContext
    {
        public LifeTreeContext(string connnectionString)
            : base(connnectionString)
        {

        }

        public IDbSet<Task> Tasks { get; set; }

        public IDbSet<Workbook> Workbooks { get; set; }

        public IDbSet<T> GetSetByType<T>() where T : class
        {
            return this.Set<T>();
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            //modelBuilder.Conventions.Remove<IncludeMetadataConvention>();
        }
    }
}
